package test0ne.设计模式.组合模式;

import java.util.ArrayList;
import java.util.List;

public class Folder extends Node {
    private String name;

    public List<Node> children = new ArrayList<Node>();

    public Folder(String name) {
        super(name);

    }

    @Override
    public void add(Node child) {
        children.add(child);
    }

    @Override
    public void ls(int space) {
        super.ls(space);
        space++;
        for (Node child: children) {
            child.ls(space);
        }
    }
}
